<template>
  <div id="father">
    <div class="son">
      <div class="tds">业务编号</div>
      <div class="tds" v-for="(n,index) in service" :key="index">
        {{n.servicenumber}}
      </div>
    </div>
    <div class="son">
      <div class="tds">业务类型</div>
      <div class="tds" v-for="(s,index) in servicetypes" :key="index">
        {{s}}
      </div>
    </div>
    <div class="son">
      <div class="tds">业务状态</div>
      <div class="tds" v-for="(se,index) in servicestatus" :key="index">
        {{se}}
      </div>
    </div>
    <div class="son">
      <div class="tds">申请人</div>
      <div class="tds" v-for="(p,index) in proposers" :key="index">
        {{p}}
      </div>
    </div>
    <div class="son">
      <div class="tds">受理时间</div>
      <div class="tds" v-for="(t,index) in times" :key="index">
        {{t}}
      </div>
    </div>
    <div class="son">
      <div class="tds">操作</div>
      <div class="tds" v-for="(s,index) in service" :key="index">
        <input type="button" class="but" value="资料录入" @click="luru(s.serviceid,s.servicetypeid)"/>
      </div>
    </div>
    <div>

    </div>

  </div>
</template>

<script>
export default {
  name: "ZiLiaoLuRu",
  data(){
    return{
      times : null,
      time :null,
      servicetypes:null,
      servicestatus:null,
      proposers:null,
      service:null,
      serviceid:null
    }
  },

  mounted() {
    this.show();
  },
  methods: {
    show() {
      this.sa.ajax("/yewu/findshouli", {},
          function (resp) {
        var maintime = resp.data.time;
            console.log(resp);
            this.times = maintime;
            for (let i = 0; i < this.times.length; i++) {
             maintime[i]= this.sa.forDate(this.times[i],2);
            }
            this.time=maintime;
            this.servicetypes =resp.data.servicetype;
            this.servicestatus=resp.data.servicestatus;
            this.proposers=resp.data.proposers;
            this.service=resp.data.service.list
          }.bind(this),
          {type: 'get'}
      )
    },
    luru(id,type){
      var tab;
      switch (type){
        case 1:
           tab = {id: 'syqLuRu', name: '所有权录入', view: () => import('@/sa-view/jkt/LuRu/syqLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
        case 2:
           tab = {id: 'ysLuRu', name: '预售录入', view: () => import('@/sa-view/jkt/LuRu/ysLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
        case 3:
           tab = {id: 'txqxfLuRu', name: '他项权[现房]录入', view: () => import('@/sa-view/jkt/LuRu/txqxfLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
        case 4:
           tab = {id: 'txqzjLuRu', name: '他项权[在建]录入', view: () => import('@/sa-view/jkt/LuRu/txqzjLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
        case 6:
           tab = {id: 'cfLuRu', name: '查封录入', view: () => import('@/sa-view/jkt/LuRu/cfLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
        case 7:
           tab = {id: 'yyLuRu', name: '异议录入', view: () => import('@/sa-view/jkt/LuRu/yyLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
        case 8:
           tab = {id: 'zxLuRu', name: '解封录入', view: () => import('@/sa-view/jkt/LuRu/zxLuRu.vue'), params: {id: id}};
          this.sa_admin.showTab(tab);
          break;
      }
    }
  }
}

</script>

<style scoped>
  #father{
    width: 100%;
    height: 800px;
    padding-left: 5%;
  }
  .son{
    float: left;
    width: 15%;
    height: 100%;
  }
  .tds{
    float: left;
    width: 100%;
    height: 30px;
    border-top: 1px black solid;
    border-bottom:1px black solid;
    text-align: center;
    font-size: 110%;
  }
  .but{
    border-radius: 10px;
    background-color: #42b983;
    color: white;
    border: 2px seagreen solid;
    width: 80px;
    height: 95%;
  }

</style>
